#ifndef _Shared_H_
#define _Shared_H_

/******************************************************************************

Description:
  This file includes shared stuff that is used in multiple source files. 
  Currently it includes a fix so that hash_map's could be constructed from
  string variables.

Author: Tayfun Sen
Website: http://blog.tayfunsen.com
 
 *****************************************************************************/

#include <string>
#include <ext/hash_map>

using namespace __gnu_cxx;
using namespace std;

/** BEGIN FIX **/
// Fix for hash not accepting strings.
// Errors such as:
//      hashtable.h:595: error: no match for call to ‘(const hash<string>) (
//            const string &)’
// are fixed. See http://gcc.gnu.org/ml/libstdc++/2002-04/msg00107.html
namespace __gnu_cxx
{
    template<> struct hash< std::string >
    {
        size_t operator()( const std::string& x ) const
        {
            return hash< const char* >()( x.c_str() );
        }
    };
} 
/** END FIX **/

#endif

